const platform=process.platform;
let filePath=""
switch(platform){
    case "linux":
        filePath=__dirname+"/global.js";
        break;
    case "win32":
        filePath=__dirname+"\\global.js";
        break;
    default:
        console.log("other platform")
}

//最佳的解决方案，使用path模块完成文件路径拼接
const path=require("path");
filePath=path.join(__dirname,"global.js");
console.log(filePath)